package com.sale.system.controller;


import cn.dev33.satoken.annotation.SaCheckPermission;
import com.sale.common.core.web.controller.BaseController;
import com.sale.common.mybatis.core.page.PageQuery;
import com.sale.common.mybatis.core.page.TableDataInfo;
import com.sale.system.domain.dto.SysWorkbenchAuditAgentDto;
import com.sale.system.domain.vo.SysWorkbenchAuditAgentVo;
import com.sale.system.service.SysWorkbenchAuditAgentService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * 审核代办控制层
 */
@RestController
@RequestMapping("/sys-workbench-audit-agent")
public class SysWorkbenchAuditAgentController extends BaseController {

    /**
     * 审核代办service
     */
    @Resource
    SysWorkbenchAuditAgentService sysWorkbenchAuditAgentService;

    /**
     * 审核代办分页列表
     * @param sysWorkbenchAuditAgentVo
     * @return
     */
    //@SaCheckPermission("system:examineTo:list")
    @GetMapping("/list")
    public TableDataInfo<SysWorkbenchAuditAgentDto> list(SysWorkbenchAuditAgentVo sysWorkbenchAuditAgentVo, PageQuery pageQuery) {
        return  sysWorkbenchAuditAgentService.getList(sysWorkbenchAuditAgentVo,pageQuery);
    }

    /**
     * 批量新增审核待办
     */
    //@SaCheckPermission("system:examineTo:add")
    @PostMapping("/insertAuditAgent")
    public boolean insertAuditAgent(@RequestBody SysWorkbenchAuditAgentVo sysWorkbenchAuditAgentVo) {
        return sysWorkbenchAuditAgentService.insertAuditAgent(sysWorkbenchAuditAgentVo);
    }

    /**
     * 修改审核代办状态
     */
    //@SaCheckPermission("system:examineTo:edit")
    @PutMapping("/updateStatus")
    public boolean updateStatus(int status,String receiptNumber,String modelName){
        return sysWorkbenchAuditAgentService.updateStatus(status,receiptNumber,modelName);
    }

    /**
     * 删除审核代办
     */
    //@SaCheckPermission("system:examineTo:remove")
    @DeleteMapping("/deleteDoc")
    public boolean deleteDoc(String receiptNumber,String modelName){
        return sysWorkbenchAuditAgentService.deleteDoc(receiptNumber,modelName);
    }

}
